class CartModel {
  final int? id;
  final int catalogId;
  final String catalogName;
  final double price;

  CartModel({
    this.id,
    required this.catalogId,
    required this.catalogName,
    required this.price,
  });

  Map<String, dynamic> toMap() {
    return {
      'id': id,
      'catalog_id': catalogId,
      'catalog_name': catalogName,
      'price': price,
    };
  }

  factory CartModel.fromMap(Map<String, dynamic> map) {
    return CartModel(
      id: map['id'] as int,
      catalogId: map['catalog_id'],
      catalogName: map['catalog_name'],
      price: map['price'],
    );
  }
}
